import instance from "@/utils/request";

// 注册
export const register = (data)=>{
    return instance.post('/user/registered',data)
}

// 登录
export const login = (data) =>{
    return instance.post('/user/login',data)
}


// 获取城市信息
export const city = ()=>{
    return instance.get('/area/city?level=1')
}
// 获取区域列表
export const region = (data) =>{
    return instance.get(`/houses/condition?id=${data}`)
}

// 获取房屋列表
export const house =(data,num)=>{
    return instance.get(`/houses?cityId=${data}&star=1&end${num}`)
}

// 租房小组
export const grop =()=>{
    return instance.get('/home/groups?area=AREA%7C88cff55c-aaa4-e2e0')
}

// 首页轮播图
export const swiper=()=>{
    return instance.get('/home/swiper')
}

// 房屋详情页
export const details=(data)=>{
    return instance.get(`/houses/${data}`)
}


// 用户登录
export const index = (data)=>{
    return instance.get('/user',{headers:{
        authorization:data}})
}